home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / MacTechNotes / Platforms & Tools / Stand-Alone Code Folder / SAGlobalsƒ / SAGlobals.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-15  |  2.0 KB  |  51 lines  |  [TEXT/MPS ]

  1.  
  2. /* Stand-alone code modules which need to use global variables
  3.    may include the interfaces in this unit. Such code modules
  4.    must also be linked with Runtime.o and SAGlobals.o. */
  5.  
  6. #include <Types.h>
  7. typedef Handle A5RefType;
  8.  
  9.  
  10. /* MakeA5World allocates space for an A5 world based on the
  11.   size of the global variables defined by the module and its
  12.   units. If sufficient space is not available, MakeA5World
  13.   returns NIL for A5Ref and further initialization is aborted. */
  14. pascal void MakeA5World (A5RefType *A5Ref);
  15.  
  16.  
  17. /* SetA5World locks down a previously-allocated handle containing
  18.    an A5 world and sets the A5 register appropriately. The return
  19.    value is the old value of A5 and the client should save it for
  20.    use by RestoreA5World. */
  21. pascal long SetA5World (A5RefType A5Ref);
  22.  
  23. /* RestoreA5World restores A5 to its original value (which the
  24.    client should have saved) and unlocks the A5 world to avoid
  25.    heap fragmentation in cases where the world is used again. */
  26. pascal void RestoreA5World (long oldA5, A5RefType A5Ref);
  27.  
  28. /* DisposeA5World simply disposes of the A5 world handle. */
  29. pascal void DisposeA5World (A5RefType A5Ref);
  30.  
  31. /* OpenA5World combines MakeA5World and SetA5World for the majority
  32.    of cases in which these two routines are called consecutively. An
  33.    exception is when a single A5 world is invoked many times. In this
  34.    case, the world is only created once with MakeA5World and it is
  35.    invoked each time by SetA5World. Most developers will find it easier
  36.    just to call OpenA5World and CloseA5World at the end. If the memory
  37.    allocation request fails, OpenA5World returns NIL for A5Ref and zero
  38.    in the function result. */
  39. pascal long OpenA5World (A5RefType *A5Ref);
  40.  
  41. /* CloseA5World is the dual of OpenA5World. It combines RestoreA5World
  42.    and DisposeA5World. Again, in certain cases it may be necessary to
  43.    call those two routines explicitly, but most of the time CloseA5World
  44.    is all that is required. */
  45. pascal void CloseA5World (long oldA5, A5RefType A5Ref);
  46.  
  47.  
  48. #if defined    (BuildLib)
  49.     #include "SAGlobals.inc1.c"
  50. #endif
  51.